package com.example.androidkotlinmvvm

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp

class ListActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
                list(innerPadding)
            }
        }
    }

    @Composable
    fun list(innerPadding: PaddingValues){
        val lists= listOf("1","2","3","4","5","6","7","8","9","10","11","12","13")
        LazyColumn(
            modifier = Modifier.padding(innerPadding).fillMaxWidth()
        ){
            items(lists) { item ->
                Text(text = item,modifier=Modifier.height(100.dp).fillMaxWidth(), textAlign = TextAlign.Center )
            }
        }

    }
}